<!DOCTYPE html>
<!-- saved from url=(0048)http://wx.zhongfubang.com/new_info.html?new_id=1 -->
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<link rel="stylesheet" type="text/css" href="./css/list-to-detail.css">
		<style>
			
		</style>
		<style type="text/css" abt="234"></style>
		<style type="text/css"></style>
		<script src="js/jquery-1.10.2.min.js"></script>
		<script type="text/javascript" src="./js/common.js"></script>
		<link href="./css/mui.min.css" rel="stylesheet" />
		
		<script>
			
			
			function pay(){
				$.ajax({
					type: "POST",
					url: root+"wechat/jsAPIorder?code="+$.getUrlParam("code"),
					data: {},
					dataType: "json",
					success: function(result) {
						if(result.status=="success"){
							payAction(result.data);
						}else{
							alert("支付出错");
						}
					},
					error: function(XMLHttpRequest, textStatus, errorThrown) {
						alert("请求异常");
					}
	});
			}
			
			function payAction(data){
				 WeixinJSBridge.invoke( 'getBrandWCPayRequest', {
                "appId":data.appId,     //公众号名称,由商户传入
                "timeStamp":data.timeStamp,         //时间戳,自1970年以来的秒数
                "nonceStr":data.nonceStr, //随机串
                "package":data.package,
                "signType":data.signType,         //微信签名方式：
                "paySign":data.paySign //微信签名
            }, function(res){
                console.log(res);
               if(res.err_msg == "get_brand_wcpay_request:ok" ){
               		alert("支付成功");
               		mui.toast('支付成功');
               		window.location.href = "order_list.html?pay=success";
      			  } 
            	});
			}
			pay();
		</script>
		
	</head>
	<body>
	</body>	

</html>